<?php
class a {
	static function getH1FromHtml($sourse) {
		$html = str_get_html ( $sourse );
		$result = $html->find ( 'h1' );
		$aryResult = array ();
		foreach ( $result as $list ) {
			$aryResult [] = $list->innertext;
		}
		$html->clear ();
		$result = '';
		if (count ( $result ) > 0) {
			$result = $aryResult [0];
		}
		return $result;
	}
}
?>